import {createRouter, createWebHashHistory} from 'vue-router'

const routes = [
   {
      path: '/',
      name: 'Index',
      meta: {
         showTabbar: true //展示标签栏
      },
      component: () => import('../views/Index.vue'),
   },
   {
      path: '/login',
      name: 'Login',
      component: () => import('../views/account/Login.vue'),
   },
   {
      path: '/register',
      name: 'Register',
      component: () => import('../views/account/Register.vue'),
   },
   {
      path: '/category/:categoryId',
      name: 'Category',
      component: () => import('../views/product/Category.vue'),
   },
   {
      path: '/product/:productId',
      name: 'Product',
      component: () => import('../views/product/Detail.vue'),
   },
   {
      path: '/search',
      name: 'Search',
      component: () => import('../views/Search.vue'),
   },
   {
		path: '/order/preview',
		name: 'OrderPreview',
		component: () => import('../views/order/Preview.vue')
	},
   {
		path: '/order/payRes',
		name: 'OrderPay',
		component: () => import('../views/order/PayRes.vue')
	},
   {
		path: '/order/list',
		name: 'OrderList',
		component: () => import('../views/order/List.vue')
	},
   {
		path: '/order/detail',
		name: 'OrderDetail',
		component: () => import('../views/order/Detail.vue')
	},
   {
		path: '/order/deliveryInfo',
		name: 'OrderDeliveryInfo',
		component: () => import('../views/order/Delivery.vue')
	},
   {
		path: '/order/refund',
		name: 'OrderRefund',
		component: () => import('../views/order/Refund.vue')
	},
   {
      path: '/cart',
      name: 'Cart',
      meta: {
         showTabbar: true //展示标签栏
      },
      component: () => import('../views/member/Cart.vue'),
   },
   {
		path: '/address/list',
		name: 'ListAddress',
		component: () => import('../views/address/List.vue')
	},
   {
		path: '/address/edit',
		name: 'EditAddress',
		component: () => import('../views/address/Edit.vue')
	},
   {
      path: '/mine',
      name: 'Mine',
      meta: {
         showTabbar: true //展示标签栏
      },
      component: () => import('../views/member/Mine.vue'),
   },
   {
		path: '/comment/list',
		name: 'CommentList',
		component: () => import(`../views/comment/List.vue`),
	},
	{
		path: '/comment/edit',
		name: 'CommentEdit',
		component: () => import(`../views/comment/Edit.vue`),
	},
	{
		path: '/comment/info',
		name: 'CommentInfo',
		component: () => import(`../views/comment/Info.vue`),
	},
   {
      path: '/*',
      redirect: '/',
   },
]

const router = createRouter({
   history: createWebHashHistory(),
   routes
})
export default router